3 Author: Andrés Mejía-Posada
4 (http://blogaritmo.factorcomun.org)
29 #define D(x) cout << #x " is " << x << endl
32 //freopen("gattaca.in", "r", stdin);
38 int n
= s
.size(), rep
= 0;
41 for (int i
=0; i
<n
; ++i
){
43 for (int j
=i
; j
< n
; ++j
){
45 int t
= ++cnt
[so_far
];
46 if (t
> 1 && (so_far
.size() > ans
.size() || (so_far
.size() == ans
.size() && so_far
< ans
))){
52 if (rep
== 0) cout
<< "No repetitions found!\n";
53 else cout
<< ans
<< " " << rep
<< endl
;